package main

import (
	"fmt"
	"math/rand"
)

func main() {
	//  1、99乘法表
	for i := 1; i < 10; i++ {
		for j := 1; j <= i; j++ {
			fmt.Printf("%d*%d=%d\t", j, i, i*j)

		}
		fmt.Println()
	}
	// 2、随机数
	sum := 0
	product := 1
	for a := 1; a <= 20; a++ {
		num := rand.Intn(20) + 1
		if num%2 != 0 {
			sum += num
		} else {
			product *= num
		}
	}
	fmt.Printf("单数求和：%v\n偶数求积：%v", sum, product)
}
